package com.learn.demo.dubbo.biz.impl;

import com.alibaba.fastjson.JSON;
import com.learn.demo.dubbo.biz.TestUser;
import com.learn.demo.dubbo.biz.model.UserModel;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * @author lwt<br>
 * @description <br>
 * @date 2020/8/31
 */
@Service
@DubboService
public class TestUserImpl implements TestUser {
    @Override
    public void sayHello() {
        System.out.println("hello world");
    }

    @Override
    public UserModel getModel(Long id) {
        UserModel userModel=new UserModel();
        userModel.setId(id);
        userModel.setUserName("userName");
        return userModel;
    }

    @Override
    public Integer saveModel(UserModel model) {
        System.out.println(JSON.toJSONString(model));
        return 1;
    }
}
